﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Globalization;
using System.Xml.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Security;
using CarBooker.Controllers;
using System.Drawing;


namespace CarBooker.Models
{
    public class CarRepository
    {
        public List<Car> Cars { get; set; }
        public CarRepository()
        {
            Cars = new List<Car>();
        }
    }

    public class CarService : ICarService
    {
        CarRepository carList = new CarRepository();

        public List<Car> AvailableCars(BookingRequest enquiry)
        {
            return enquiry.FindAvailableCars(carList);
        }
        public void BookCar() { }
        public void AddCar(CarDescription description)
        {
            carList.Cars.Add(new Car(description));
        }
    }

    public interface ICarService
    {
        List<Car> AvailableCars(BookingRequest enquiry);
        void BookCar();
        void AddCar(CarDescription description);
    }
}